/* TestOutputXml.h
*  Created by Penrillian, Smartphone Software Innovators 
*  See http://www.penrillian.com
*/

#ifndef __CXXTEST__TESTOUTPUTXML_H
#define __CXXTEST__TESTOUTPUTXML_H

#include <e32cons.h>
#include <e32base.h>
#include <e32std.h>
#include <e32des16.h>
#include <libc/string.h>
#include <utf.h>
#include <f32file.h>

_LIT(KLogFileNameXml,"c:\\logs\\SOSUnit.xml");

class CTestOutputXml : public CBase 
{
	
public:	
	~CTestOutputXml();
	CTestOutputXml& operator<<(const char* output);	
	CTestOutputXml& operator<<(TDesC8& _des);
	
	inline CTestOutputXml& operator<<(char _s){
		TBuf8<2> buf;
		buf.Append(_s);
		return operator<<(buf);
	}

	inline CTestOutputXml& operator<<(unsigned _n){
		return operator<<((int) _n);
	}

	inline CTestOutputXml& operator<<(int _n){
		TBuf8<32> buf;
		buf.AppendNum(_n);
		return operator<<(buf);
	}

	inline CTestOutputXml& operator<<(const unsigned char * _s) {  return operator<<((const char *) _s); }
	inline CTestOutputXml& operator<<(const signed char * _s) {  return operator<<((const char *) _s); }
	
	static CTestOutputXml* NewL(HBufC* iOutputText);			
	void ReplaceNumofTests(TInt failedTestsNo/*, TInt numTotalTests*/);
	
	TBool PrintSuccessfulTests;
	
private:
	void ConstructL();
	void WriteToXmlFileL(TDesC8& _des);
	CTestOutputXml(HBufC* aOutputText):iOutputText(aOutputText){}

	HBufC* iOutputText;
	RFs iRfs;
	RFile iFile;


};


#endif // __CXXTEST__TESTOUTPUTXML_H
